﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var typemanage_type_to_type = "_{typemanage_type_to_type}";
	var typemanage_js_noselect_empty = "_{typemanage_js_noselect_empty}";
	var typemanage_js_type_shift_typeselect_err = "_{typemanage_js_type_shift_typeselect_err}";
	var typemanage_js_type_shift_ok = "_{typemanage_js_type_shift_ok}";
	var typemanage_js_type_shift_no = "_{typemanage_js_type_shift_no}";
	var iframename = "#{iframename}";
	$(document).ready(function(){
	    var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#typeshift').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		parent.scrolclear();
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['shifttid']==0){
			document.typeshift.shifttid.focus();
			alert(typemanage_type_to_type+typemanage_js_noselect_empty);
			return false;
		}
		if(get['shifttid']==get['tid']){
			document.typeshift.shifttid.focus();
			alert(typemanage_js_type_shift_typeselect_err);
			return false;
		}
		parent.windowsdig('Loading','iframe:#{load}','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(typemanage_js_type_shift_ok);
		}else{
			alert(typemanage_js_type_shift_ok);
		}
		parent.scrolopen();
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="typeshift" id="typeshift" method="post" action="#{ActionLink}">
<input type="hidden" name="inputclass" value="shift" />
<input type="hidden" name="tid" value="#{typeread.Id}" />
<input type="hidden" name="inputupid" id="inputupid" value="#{typeread.upid}" />
<input type="hidden" name="topid" value="#{typeread.topid}" />
<input type="hidden" name="lng" value="#{typeread.lng}" />
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<!--查看已选择的类型-->
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="colorgorningage">_{typemanage_type_shift_mess} <u>#{typeread.typename}</u></span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{typemanage_type_add_lng}</td>
						<td width="85%" class="trtitle02 colorgblue">#{typeread.lng}</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{subjectmanage_type_add_mid}</td>
						<td width="85%" class="trtitle02 colorgblue">#{typeread.ModelName}<input type="hidden" name="mid" value="#{typeread.mid}"></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{typemanage_type_add_dirname}</td>
						<td width="85%" class="trtitle02 colorgblue">#{typeread.dirname}<input type="hidden" name="dirname" value="#{typeread.dirname}" /></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{typemanage_type_add_dirpath}</td>
						<td width="85%" class="trtitle02 colorgblue">
                            <%var is_alonelng = Convert.ToInt32(v.data("is_alonelng")); %>
							#{file_htmldir}<%if(is_alonelng !=1){ %>#{lng}/<%} %>#{typeread.dirpath}
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{typemanage_type_to_type}</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="shifttid" id="shifttid">
								<option value="0">_{typemanage_type_add_upid_option2}</option>
								<%var list = v.data("list") as List<TypeList>;%>
								<%foreach(var row in list){ %>
								<option value="<%=row.Id %>"><%var str = string.Empty; %><%for (var i = 1; i < row.level + 1; i++) { %><%str += "&nbsp;&nbsp;&nbsp;&nbsp;"; %><%} %><%=str %><%if(row.level >0){ %>├─ <%} %> <%=row.typename %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{typemanage_type_to_type2}</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isshift"/> _{is_yes}&nbsp;
							<input type="radio" value="0" name="isshift" checked="checked"/> _{is_no}
							<span class="cautiontitle">_{typemanage_type_to_type2_mess}</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" name="Submit" value="_{botton_shift}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="_{botton_edit_reset}" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>